﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.Common;
using AAA.DataAccess.Meta;

namespace AAA.DataAccess
{
    public interface IDataAccess
    {
        string ErrorMessage { get; set;}
        string ExecuteSQL { get; }
        Dictionary<string, object> ExecuteParam { get; }

        void AddFieldHeader(string strFieldName, string strHeader);
        string GetFieldHeader(string strFieldName);

        void AddParam(string strName, object oValue);
        void AddParam(Dictionary<string, object> dicParam);
        void RemoveParamByValue(List<object> lstValue);
        object GetParam(string stringName);
        Dictionary<string, object> GetAllParam();

        /* Move To AbstractDatabasDataAccess
        void AddCriteria(string strCriteria, string[] strCheckFields);
        void AddCriteria(string strCriteria, string[] strCheckFields, CriteriaTypeEnum eCriteriaType);
        void AddCriteria(string strCriteria, string[] strCheckFields, NullValueProcessEnum eNullValueProcess);
        void AddCriteria(string strCriteria, string[] strCheckFields, CriteriaTypeEnum eCriteriaType, NullValueProcessEnum eNullValueProcess);
        */

        void AddData(DbDataReader dataReader);
        void AddData(object oName, DbDataReader dataReader);
        void AddData(DataTable dataTable);
        void AddData(object oName, DataTable dataTable);
        DataTable GetData();
        DataTable GetData(object oName);

        void SetConfig(DatabaseInfo databaseInfo);
        bool LoadConfig();

        bool Connect();
        bool Disconnect();
        bool Execute();
        bool Execute(object oDataSet);

        bool BeforeExecute();        
        bool ExecuteCommand(object oDataSet);
        bool AfterExecute();
        
    }
}
